<template>
  <div>
    Child-2 - {{subTitle}}
  </div>
</template>

<script>
import eventBus from '@/plugin/eventBus'

export default {
  name: 'Child2',
  props: {
    subTitle: {
      type: String,
      default: 'subTitle'
    }
  },
  created() {
    eventBus.$on('handleClick', res => {
      console.log(1, res)
    })

    this.$root.$on('handleClick1', res => {
      console.log(2, res)
    })

    this.$eventBus.on('handleClick', res => {
      console.log(3, res)
    })
  }
}
</script>
